package com.epalmpay.service.weixin;

import com.epalmpay.exception.ApplicationException;
import com.epalmpay.dto.member.SubscribeMemberDTO;
import com.epalmpay.util.Response;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created by wzq on 2017/7/2.
 */
public interface IWxApiMemberService {

    //查询银行列表
    public Response  bankList(String memberId) throws ApplicationException;
    //查询银行列表 区分借记卡信用卡
    public Response bankListSort(String memberId) throws ApplicationException;
    //查询银行卡详情
    public Map<String, Object> bankCardDetil(String memberId, String cardId) throws Exception;
    //删除绑定的银行卡
    public Boolean updateUnBindBankCard(String memberId, String cardId) throws Exception;
    //银行卡充值认证
    public Map<String, Object> insertBankCardVefity(String memberId,String tranAmt, String bankCode,String cardNum,
                                    String idName,String idNo,String cardMobile,
                                    String cardCvn,String cardExpdate,String Ip,String payType) throws ApplicationException;
    //银行卡消费认证
    public Map<String, Object> insertBankCardVefityConsumption(String memberId,String tranAmt, String bankCode,String cardNum,
                                    String idName,String idNo,String cardMobile,
                                    String cardCvn,String cardExpdate,String Ip,String orgOrderNum) throws ApplicationException;
    
    /**
	 * 用户发起提现
	 * @param memberId
	 * @param orderId
	 * @param tranAmt
	 * @param cardId
	 * @param payPwd
	 * @return
	 * @throws ApplicationException
	 */
	public HashMap<String, Object> updateWxlyWithdraw(String memberId,Integer tranAmt,String cardId,String payPwd,Integer fee) throws ApplicationException;
	
	public Response sendWxlyWithdraw(HashMap<String, Object> map, Integer tranAmt,String payPwd,Integer fee) throws ApplicationException;
    /**
     * 
     * @param memberId 会员id
     * @param accName 持卡人姓名
     * @param accNo   银行卡号
     * @param bankName 开户银行
     * @param certNo   身份证
     * @param mobile   手机号
     * @param payPwd   支付密码
     * @param cardType 银行卡类型 01借记卡 02 信用卡
     * @return
     * @throws ApplicationException
     */
    public Map<String, Object> updateMemberBankCard(String memberId, String accName,String accNo,String bankName,String certNo, String mobile, 
		    String payPwd,String cardType,String bankCode) throws ApplicationException;
    //银行卡认证提交
    public Map<String, Object> updatebankcardverifysubmit(String memberId,String code,String Ip) throws ApplicationException;
    /**
     * 已有银行卡直接支付充值
     * @param memberId
     * @param Ip
     * @param cardId
     * @param tranAmt
     * @param payType
     * @param orgOrderNum
     * @return
     * @throws ApplicationException
     */
    public Map<String, Object> updateExistCardsubmit(String memberId,String Ip,String cardId,String tranAmt,String payType,String orgOrderNum) throws ApplicationException;
    
    /**
     * 已有银行卡直接支付消费
     * @param memberId
     * @param Ip
     * @param cardId
     * @param tranAmt
     * @param payType
     * @param orgOrderNum
     * @return
     * @throws ApplicationException
     */
    public Map<String, Object> updateExistCardsubmitConsumption(String memberId,String Ip,String cardId,String tranAmt,String orgOrderNum) throws ApplicationException;
    //转账
    public Map<String, Object> insertUserTransfer(String memberId, String phone,String toMemberId,Integer amount,String password,Integer fee,String rootHomeUrl) throws ApplicationException;
    /**
     * 转账 详情
     * @param orderNum 订单号
     * @return
     */
    Response findOrderNum(String orderNum)throws ApplicationException;
    
    //转账手续费计算
    public Map<String, Object> selectFee(String memberId,Integer tranAmt,String type) throws ApplicationException;
    /**
     * 手续费说明
     * @param memberId
     * @param type
     * @return
     * @throws ApplicationException
     */
    public Response userFeeExplain(String memberId,String type) throws ApplicationException;
    /**
     * 手续费说明
     * @param memberId
     * @param type
     * @return
     * @throws ApplicationException
     */
    public Response feeExplain(String memberId,String type) throws ApplicationException;
    //账单列表
    public Map<String, Object> getTradeDetailList(String memberId, Integer offOrOnLine,Integer pageNo,Integer pageSize) throws Exception;
    //订单评价
    public Map<String, Object> insertServiceGoodOrderComment(String memberId,String orderId,Integer isDisplay, Integer commentLevel,String commentContent,String picUrls) throws Exception;
    /**
     * 邀请会员参与活动
     * @param groupId
     * @param memberId 原会员id 
     * @param newMemberId  新注册会员id
     * @return
     * @throws Exception
     */
    public Map<String, Object> insertInviteMember(Long groupId,Long memberId, Long newMemberId) throws Exception;
    //领取红包
    public Map<String, Object> insertRedpackageUser(String memberId, String redpackageUserId)throws Exception;
    //获取购物车
    public List<Map<String, Object>> getMallCart(Long memberId);
    //添加商品到购物车
    public int insertMallCart(String memberId, String goodsId,Integer number,Long specId,Long shareMemberId)throws Exception;
    //移除购物车中商品
    public int deleteMallCart(String memberId, String goodsId)throws Exception;

    //保存地址信息
    public int saveMyAddress(String memberId, Integer defaultSelect,String addressMobilePhone,
                             String addressCustomerName,String addressCity,String addressArea,Long addressId)throws Exception;
    //获取地址列表
    public Map<String, Object> getMyAddressList(String memberId) throws Exception;
    //获取缺省地址
    public Map<String, Object> getDefaultAddress(String memberId) throws Exception;
    //删除地址
    public int deleteMyAddress(String memberId,Long addressId) throws Exception;
    public int setDefaultMyAddress(String memberId,Long addressId) throws Exception;

	//完成用户绑卡
	public Response addQuickRechargeMemberCard(String groupId,Long memberId,String cardNum,String customerName,String mobilePhone,
			String certNo,String issuerId,Long cardId,String expdate,String cvn,String bankCodeNew);


    //获取广告列表
    public Map<String, Object> getAdvertList(String memberId,Integer advertType) throws Exception;
    //获取消息列表
    public Map<String, Object> getMessageList(String memberId,Integer messageType,Integer pageNo,Integer pageSize) throws Exception;
    //更新消息
    public int updateMessageById(String memberId,Integer messageId,Integer status) throws Exception;

    Response shopSaleList(Long memberId, Integer pageNo, Integer pageSize, Integer status);

    Response shopSaleOrderDetail(Long memberId, Long shopId, String orderId, String user_latitude, String user_longitude) throws Exception;

    Response saveShopSaleOrderEvaluate(Long memberId, Long shopId, String orderId, String evaluateContent, Integer evaluateSorce, Boolean isAnonymous, String picUrls);

    public Map<String, Object> couponhavegottendetail(String memberId,String couponuserId) throws Exception;

    Response rechargeBenefit(Long memberId);
    
    /**
     * 会员钱包权限
     * @param memberId
     * @return
     */
    Response memberWalletCompetence (Long memberId);
    
    
    public Response getServiceCouponsList(Long memberId,Long goodOrShopId, Integer tradeMoney) throws ApplicationException, Exception;
    /**
     * 普通关注会员
     * @param homeUrl
     * @param subscribeMember
     * @param nickname
     * @param hrefName
     * @return
     */
    public String subscribeUrl(String homeUrl,SubscribeMemberDTO subscribeMember,String nickname,String openId);
    /**
     * 关注送红包
     * @param homeUrl
     * @param subscribeMember
     * @param nickname
     * @param hrefName
     * @return
     */
    public String subscribeSendEnvelope(String homeUrl,SubscribeMemberDTO subscribeMember,String nickname,String hrefName);
    /**
     * 会员邀请关注
     * @param homeUrl
     * @param subscribeMember
     * @param nickname
     * @param hrefName
     * @return
     */
    public String subscribeMember(String homeUrl,SubscribeMemberDTO subscribeMember,String nickname,String hrefName);

    Map<String,Object> findMemberDisCount(String memberId);
}
